import { _decorator, Component, Node } from 'cc';
import { PinActrion } from './PinActrion';
import { SlotAction } from './SlotAction';
const { ccclass, property } = _decorator;

@ccclass('LayerSlotAction')
export class LayerSlotAction extends Component {
    start() {

    }

    update(deltaTime: number) {
        
    }

    putPin(pin: PinActrion): boolean {
        let ret = false;
        for (let i = 0; i < this.node.children.length; i++) {
            const child = this.node.children[i];
            if (child.getComponent(SlotAction)) {
                const catAction = child.getComponent(SlotAction);
                if (catAction.putPin(pin)) {
                    ret = true;
                    break;
                }
            }
        }
        return ret;
    }
}


